]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray.js: raise an exception only if parseInt(count) returns NaN
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 7 Jul 2011 13:35:37 +0000 (15:35 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 7 Jul 2011 13:47:12 +0000 (15:47 +0200)
0 is a valid value for count so we should accept it.

https://bugzilla.gnome.org/show_bug.cgi?id=654139

js/ui/messageTray.js

index a29dedebd88ef4a4d8b9db7bbf8baa9cb682cf37..bd55a3133306a8a82b3f4e59629780bf71be1030 100644 (file)
@@ -941,7 +941,7 @@ Source.prototype = {
     },
 
     _setCount: function(count, visible) {
-        if (!parseInt(count))
+        if (isNaN(parseInt(count)))
             throw new Error("Invalid notification count: " + count);
 
         this._counterBin.visible = visible;